<%@ Page 
  Language="C#" 
  AutoEventWireup="true"  
  CodeFile="DemoEmployees.aspx.cs" 
  Inherits="DemoCodeGen.DemoEmployees" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:Button ID="BtnQuery" runat="Server" OnClick="BtnQuery_Click" />
      
      <asp:GridView 
        ID="grvMaster" 
        runat="server" 
        DataSourceID="dsMaster"
        AllowPaging="true"
        PageSize="3"    
        AutoGenerateColumns="false">    
        <Columns>
          <asp:TemplateField>
            <ItemTemplate>
              <asp:Button ID="tfDelete" Text="Delete" CommandName="Delete" runat="Server" />
            </ItemTemplate>
          </asp:TemplateField>     
          <asp:TemplateField>
            <ItemTemplate>
              <asp:Button ID="tfSelect" Text="Edit" CommandName="Select" runat="Server" />
            </ItemTemplate>
          </asp:TemplateField>               
          <asp:TemplateField HeaderText="EmployeeID">
            <ItemTemplate>
              <asp:Label ID="tfEmployeeID" Text='<%# Bind("EmployeeID") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="LastName">
            <ItemTemplate>
              <asp:Label ID="tfLastName" Text='<%# Bind("LastName") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="FirstName">
            <ItemTemplate>
              <asp:Label ID="tfFirstName" Text='<%# Bind("FirstName") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="Title">
            <ItemTemplate>
              <asp:Label ID="tfTitle" Text='<%# Bind("Title") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="TitleOfCourtesy">
            <ItemTemplate>
              <asp:Label ID="tfTitleOfCourtesy" Text='<%# Bind("TitleOfCourtesy") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="BirthDate">
            <ItemTemplate>
              <asp:Label ID="tfBirthDate" Text='<%# Bind("BirthDate") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="HireDate">
            <ItemTemplate>
              <asp:Label ID="tfHireDate" Text='<%# Bind("HireDate") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="Address">
            <ItemTemplate>
              <asp:Label ID="tfAddress" Text='<%# Bind("Address") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="City">
            <ItemTemplate>
              <asp:Label ID="tfCity" Text='<%# Bind("City") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="Region">
            <ItemTemplate>
              <asp:Label ID="tfRegion" Text='<%# Bind("Region") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="PostalCode">
            <ItemTemplate>
              <asp:Label ID="tfPostalCode" Text='<%# Bind("PostalCode") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="Country">
            <ItemTemplate>
              <asp:Label ID="tfCountry" Text='<%# Bind("Country") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="HomePhone">
            <ItemTemplate>
              <asp:Label ID="tfHomePhone" Text='<%# Bind("HomePhone") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="Extension">
            <ItemTemplate>
              <asp:Label ID="tfExtension" Text='<%# Bind("Extension") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="Photo">
            <ItemTemplate>
              <asp:Label ID="tfPhoto" Text='<%# Bind("Photo") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="Notes">
            <ItemTemplate>
              <asp:Label ID="tfNotes" Text='<%# Bind("Notes") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="ReportsTo">
            <ItemTemplate>
              <asp:Label ID="tfReportsTo" Text='<%# Bind("ReportsTo") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
          <asp:TemplateField HeaderText="PhotoPath">
            <ItemTemplate>
              <asp:Label ID="tfPhotoPath" Text='<%# Bind("PhotoPath") %>' runat="server" />
            </ItemTemplate>
          </asp:TemplateField> 
          
        </Columns>
      </asp:GridView>
      
      <asp:ObjectDataSource 
        ID="dsMaster" 
        runat="server" 
        TypeName="DemoCodeGen.BLLEmployees" 
        DataObjectTypeName="DemoCodeGen.Employees"
        SelectMethod="SelectPaging" 
        DeleteMethod="Delete"
        SelectCountMethod="SelectCount" 
        EnablePaging="True"
        OldValuesParameterFormatString="original_{0}">
        <SelectParameters>
          <asp:Parameter Name="startRowIndex" Type="Int32" />
          <asp:Parameter Name="maximumRows" Type="Int32" />
        </SelectParameters>
      </asp:ObjectDataSource>   
    </div>
    </form>
</body>
</html>
